package com.wjgl.action;

import com.opensymphony.xwork2.ActionSupport;
import com.wjgl.domain.Role;
import com.wjgl.service.RoleService;

public class AddRoleAction extends ActionSupport {
	private RoleService roleService;
	private String roleName;
	public RoleService getRoleService() {
		return roleService;
	}
	public void setRoleService(RoleService roleService) {
		this.roleService = roleService;
	}
	public String getRoleName() {
		return roleName;
	}
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		Role role = new Role();
		role.setName(roleName);
		roleService.addRole(role);
		return SUCCESS;
	}
	
	
}
